package com.common.mybatis.enums.member;

import com.common.mybatis.dict.annotation.EnumDictAnnotation;
import com.common.mybatis.enumeration.BaseEnum;
import com.common.mybatis.enumeration.EnumUtils;

@EnumDictAnnotation("性别")
public enum Sex implements BaseEnum{

    MALE(1,"男"),
    FEMALE(2,"女"),
    ;

    private int index;
    private String description;

    Sex(int index, String description){
        this.index = index;
        this.description = description;
    }

    @Override
    public int getIndex() {
        return index;
    }

    @Override
    public String getDescription() {
        return description;
    }


    public static Sex findById(int index) {
        return EnumUtils.getEnum(Sex.class, index);
    }
}
